<template>
	<div>
		<list :show-scrollbar="false">
			<cell>
				<!-- 轮播图组件 -->
				<hc-slider :swipers="swipers"></hc-slider>
				<!-- 图标分类组件 -->
				<index-navs :resdata="indexNavs" />
				<!-- 全局分割线 -->
				<divider />
				<!-- 三图广告 -->
				<hc-three-adv :item="threeAdv" />
				<divider />
				<!-- 大图广告 -->
				<hc-one-adv :item="oneAdv" />
				<!-- 公共列表组件 -->
				<div class="w-100 row">
					<block v-for="(item,index) in list" :key="index">
						<common-list :item="item" :index="index"></common-list>
					</block>
				</div>
			</cell>
		</list>
	</div>
</template>

<script>
	// 获取当前窗口对象
	const currentWebview = plus.webview.currentWebview();
	import hcSlider from "@/components/index/nvue/hc-slider.nvue";
	import indexNavs from "@/components/index/nvue/index-navs.nvue";
	import divider from "@/components/common/divider.nvue";
	import hcThreeAdv from "@/components/index/nvue/hc-three-adv.nvue";
	import hcOneAdv from "@/components/index/nvue/hc-one-adv.nvue";
	import commonList from "../../components/common/common-list.nvue"
	export default {
		components:{
			hcSlider,
			indexNavs,
			divider,
			hcThreeAdv,
			hcOneAdv,
			commonList
		},
		data () {
			return{
				swipers:[
					{src:"/static/images/demo/demo4.jpg"},
					{src:"/static/images/demo/demo4.jpg"},
					{src:"/static/images/demo/demo4.jpg"}
				],
				indexNavs:[
					{ src:"/static/images/indexnav/1.png",name:"新品分类"},
					{ src:"/static/images/indexnav/2.gif",name:"小米众筹"},
					{ src:"/static/images/indexnav/3.gif",name:"以旧换新"},
					{ src:"/static/images/indexnav/4.gif",name:"1分拼团"},
					{ src:"/static/images/indexnav/5.gif",name:"超值特卖"},
					{ src:"/static/images/indexnav/6.gif",name:"小米秒杀"},
					{ src:"/static/images/indexnav/7.gif",name:"真心想要"},
					{ src:"/static/images/indexnav/8.gif",name:"电视热卖"},
					{ src:"/static/images/indexnav/9.gif",name:"家电热卖"},
					{ src:"/static/images/indexnav/10.gif",name:"米粉卡"}
				],
				threeAdv:[
					{src:"/static/images/demo/demo1.jpg"},
					{src:"/static/images/demo/demo2.jpg"},
					{src:"/static/images/demo/demo3.jpg"}
				],
				oneAdv:{
					cover:"/static/images/demo/demo4.jpg",
					title:"每日精选"
				},
				list:[
					{
						cover: "/static/images/demo/list/1.jpg",
						title: "米家空调",
						desc: "1.5匹变频",
						oprice: 2699,
						pprice: 1399
					}, {
						cover: "/static/images/demo/list/1.jpg",
						title: "米家空调",
						desc: "1.5匹变频",
						oprice: 2699,
						pprice: 1399
					}, {
						cover: "/static/images/demo/list/1.jpg",
						title: "米家空调",
						desc: "1.5匹变频",
						oprice: 2699,
						pprice: 1399
					}, {
						cover: "/static/images/demo/list/1.jpg",
						title: "米家空调",
						desc: "1.5匹变频",
						oprice: 2699,
						pprice: 1399
					}, {
						cover: "/static/images/demo/list/1.jpg",
						title: "米家空调",
						desc: "1.5匹变频",
						oprice: 2699,
						pprice: 1399
					}
				]
			}
		},
		created() {
			// 监听当前窗口显示
			currentWebview.addEventListener('show',e=>{
				console.log('indexShow');
			})
		},
		beforeDestroy() {
			// 移除监听事件
			currentWebview.removeEventListener('show',e=>{})
		},
		methods:{
			
		}
	}
</script>

<style src="@/common/hc-main-nvue.css"></style>